{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1457
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,n,kk,ls,t,x,y:longint;
	a:array[0..10010] of longint;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
for i:=1 to n do
	a[i]:=i;
read(x,y);
ls:=x+y;
kk:=ls div 2;
for i:=x to kk do begin
	t:=a[i];
	a[i]:=a[ls-i];
	a[ls-i]:=t;
end;
read(x,y);
ls:=x+y;
kk:=ls div 2;
for i:=x to kk do begin
	t:=a[i];
	a[i]:=a[ls-i];
	a[ls-i]:=t;
end;
for i:=1 to n do
	write(a[i],' ');
end.